
<%@page import="classes.Reports"%>
<%@page import="java.util.ArrayList"%>
        <table id="table-1">
	<thead>
                <th>Stock Symbol</th>
                <th>Company Name</th>
                <th>Price Per Share</th>
	</thead>
	<tbody>
	<%
         
            String query="SELECT S.StockSymbol, S.CompanyName, S.PricePerShare"+
                    " FROM `brchung`.`stock` S"+
                    " WHERE S.Type in(SELECT Q.type FROM `brchung`.`trade` T, `brchung`.`account` A, `brchung`.`stock` Q WHERE T.StockID = Q.StockSymbol AND T.AccountID = A.ID AND Client = '"+request.getParameter("id") +"') AND S.StockSymbol not in(SELECT S.StockSymbol FROM `brchung`.`trade` T, `brchung`.`account` A WHERE T.StockID = S.StockSymbol AND T.AccountID = A.ID AND Client = '"+request.getParameter("id")+"');";
            Reports.getConnection(query);
            ArrayList<String[]> rs=Reports.getResults(1,2,3);
            for(int i=0;i<rs.size();i++){
                out.print("<tr>");
                for(int j=0;j<3;j++)
                    out.print("<td>"+rs.get(i)[j]+"</td>");
                out.print("</tr>");
            }
        %>
	</tbody>
    </table>
